Source for file ja_splitmenu.php
Documentation is available at ja_splitmenu.php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$color =
"default"; // default color for orphan (no parent menu) links
define( 'JA_CURRENT_MENU', "active_menu");
global $mosConfig_absolute_path, $mosConfig_shownoauth, $my, $database, $Itemid, $hilightid;
if ($mosConfig_shownoauth) {
$sql =
"SELECT * FROM #__menu"
.
"\nWHERE menutype='".
$menu .
"' AND published='1' AND parent=0"
$sql =
"SELECT * FROM #__menu"
.
"\nWHERE menutype='".
$menu .
"' AND published='1' AND access <= '".
$my->gid.
"' AND parent=0"
$database->setQuery( $sql );
$topmenu =
$database->loadObjectList( 'id' );
$sql =
"SELECT * FROM #__menu"
.
"\nWHERE menutype='".
$menu .
"' AND published='1'";
$database->setQuery( $sql );
$subrows =
$database->loadObjectList( 'id' );
if (isset
($parentid) &&
$parentid >=
0 &&
$subrows[$parentid]) {
foreach ($topmenu as $menuitem) {
$hilight =
($menuitem->id ==
$hilightid);
$links[] =
ja_getSubmenu( $menuitem, 0, $colors, $hilight, true );
$menuclass =
'mainlevel';
$r .=
'<ul id="ja-splitmenu" class="'.
$menuclass .
'">';
foreach ($links as $link) {
if (isset
($rows[$id]) &&
$rows[$id]) {
if($rows[$id]->parent >
0) {
return $rows[$id]->parent;
function ja_getSubmenu( $menuitem, $depth, $colors =
null, $hilight =
false, $color_index =
false) {
global $mainframe, $tab_index, $color, $hilightid, $menuname;
switch ($menuitem->type) {
case 'component_item_link':
if ( eregi( 'index.php\?', $menuitem->link ) ) {
if ( !eregi( 'Itemid=', $menuitem->link ) ) {
$menuitem->link .=
'&Itemid='.
$menuitem->id;
case 'content_item_link':
$menuparams =
new mosParameters( $menuitem->params, $mainframe->getPath( 'menu_xml', $menuitem->type ), 'menu' );
$unique_itemid =
$menuparams->get( 'unique_itemid', 1 );
$menuitem->link .=
'&Itemid='.
$menuitem->id;
$temp =
split('&task=view&id=', $menuitem->link);
if ( $menuitem->type ==
'content_typed' ) {
$menuitem->link .=
'&Itemid='.
$mainframe->getItemid($temp[1], 1, 0);
$menuitem->link .=
'&Itemid='.
$mainframe->getItemid($temp[1], 0, 1);
$menuitem->link .=
'&Itemid='.
$menuitem->id;
$id .=
$colors[($tab_index)%
count($colors)];
if ( !$current_itemid &&
!$hilight ) {
} else if ($hilight ||
($current_itemid ==
$menuitem->id)) {
$menuname =
$menuitem->name;
$hilightid =
$menuitem->id;
$title =
"title=\"{$menuitem->name}\"
";
switch ($menuitem->browserNav) {
$r =
'<li'.
$id .
'><a href="'.
$menuitem->link .
'" target="_blank" '.
$title.
'><span>'.
$menuitem->name .
"</span></a></li>\n";
// open in a popup window
$r =
"<li".
$id .
"><a href=\"#\" onclick=\"javascript: window.open('".
$menuitem->link .
"', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\" $title><span>".
$menuitem->name .
"</span></a></li>\n";
$r =
'<li'.
$id .
'><span class="seperator">'.
$menuitem->name .
"</span></li>\n";
$r =
'<li'.
$id .
'><a href="'.
$menuitem->link .
'" '.
$title.
'><span>'.
$menuitem->name .
"</span></a></li>\n";
function ja_subNav($menutype, $pre =
NULL, $post =
NULL) {
global $my, $mosConfig_shownoauth, $Itemid, $database;
case "Super Administrator":
if ($mosConfig_shownoauth) {
$sql =
"SELECT * FROM #__menu"
.
"\nWHERE menutype='".
$menutype .
"' AND published='1'"
.
"\nORDER BY parent,ordering";
$sql =
"SELECT * FROM #__menu"
.
"\nWHERE menutype='".
$menutype .
"' AND published='1' AND access <= '$my->gid'"
.
"\nORDER BY parent,ordering";
$database->setQuery( $sql );
$rows =
$database->loadObjectList( 'id' );
$list =
@$subs[$pt] ?
$subs[$pt] :
array();
$open =
array( $Itemid );
$count =
20; // maximum levels - to prevent runaway loop
if (isset
($rows[$id]) &&
$rows[$id]->parent >
0) {
$id =
$rows[$id]->parent;
if (isset
($subs[$id]) &&
$subs[$id]) {
global $Itemid, $menuname;
if (@$subs[$id] &&
$depth<
2) {
//$n = min( $depth, count( $indents )-1 );
$r .=
"<ul class=\"" .
$sub_class .
"\">\n";
foreach ($subs[$id] as $row) {
Documentation generated on Mon, 05 May 2008 16:20:47 +0400 by phpDocumentor 1.4.0